import fetch from '../utils/fetch'

/**
 * 登录 | 注册
 */
export function sign(data) {
    return fetch({
        url: '/ygsj/designer/login',
        method: 'post',
        data: data
    })
}

/**
 * 修改密码
 */
export function updatePwd(data) {
    return fetch({
        url: '/updatePwd',
        method: 'post',
        data: data
    })
}

/**
 * userinfo
 */
export function userInfo(data) {
    return fetch({
        url: '/account/read/current',
        method: 'post',
        data: data
    })
}




/**
 * 退出登录
 */
export function logout() {
    return fetch({
        url: '/logout',
        method: 'post'
    }).then(() => {
        sessionStorage.clear()
        location.href = location.origin + '/#/work/sign'
    })
}



/**
 * 扫码注册
 */
export function thirdPartyRegister(data) {
    return fetch({
        url: '/sns/register',
        method: 'post',
        data: data
    })
}


/**
 * 扫码微信回调
 */
export function thirdPartyWexin(data) {
    return fetch({
        url: '/callback/wx',
        method: 'get',
        data: data
    })
}

/**
 * 短信验证码
 * @param smsType 短信类型 1：验证码 2：业务通知消息;
 * @param phoneNumber 手机号码
 */
export function smscode(data) {
    return fetch({
        url: '/sms/sendSms',
        method: 'post',
        data: data
    })
}




